﻿namespace Nexpress.Test
{
    class Program
    {
        static void Main(string[] args)
        {
            Application app = new Application();

            app.Use(async (req, res, next) =>
            {
                await res.Send("这是执行之前");
                await next(req, res);
                await res.Send("这是执行之后");
            });
            
            app.Get("/user", async (req, res) =>
            {
                await res.Send("测试user");
            });
            
            app.Get("/user/:id", async (req, res) =>
            {
                await res.Send("测试user,id="+req.Param["id"]);
            });
            
            app.Listen(5000);
        }
    }
}
